//
//  JXStatusCell.swift
//  01-weiboSwift
//
//  Created by TwistFate on 16/3/2.
//  Copyright © 2016年 TwistFate. All rights reserved.
//

import UIKit

class JXStatusCell: UITableViewCell {

    var status : JXStatus? {
        didSet{
            statusOriginalView.status = status
            
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        backgroundColor = UIColor(white: 237 / 255.0, alpha: 1)
        prepareUI()  
    }

  
    private func prepareUI () {
        
        
        
        contentView.addSubview(statusOriginalView)
        contentView.addSubview(statusBottomView)
        
        statusOriginalView.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(contentView)
            make.trailing.equalTo(contentView)
            make.top.equalTo(contentView).offset(JXStatusCellMargin)
//            make.height.equalTo(44)
        }
        
        statusBottomView.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(contentView)
            make.trailing.equalTo(contentView)
            make.top.equalTo(statusOriginalView.snp_bottom)
            make.height.equalTo(44)
            make.bottom.equalTo(contentView)
        }
        
        contentView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(self)
            make.leading.equalTo(self)
            make.trailing.equalTo(self)
            
            make.bottom.equalTo(statusBottomView)
        }
    
    }
    
    lazy var statusBottomView : JXStatusBottomView = JXStatusBottomView()
    
    lazy var statusOriginalView : JXStatusOriginalView = JXStatusOriginalView()
}
